﻿using Hjt212Parser;
using System.ServiceProcess;

namespace Biz
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main()
        {
            var isNotDebug = true;
            if (isNotDebug)
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new BizProcessor()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                string msg =
                    "##0374QN=20190306034714000;ST=31;CN=2011;PW=123456;MN=83028583206126;Flag=1;CP=&&DataTime=20190306034714;02-Rtd=0.07,02-ZsRtd=0.06,02-Flag=N;03-Rtd=263.09,03-ZsRtd=221.97,03-Flag=N;S03-Rtd=81.80,S03-Flag=N;S05-Rtd=40.04,S05-Flag=N;S08-Rtd=-32.19,S08-Flag=N;S01-Rtd=9.15,S01-Flag=N;01-Rtd=23.24,01-ZsRtd=19.61,01-Flag=N;B02-Rtd=6.44,B02-Flag=N;08-Rtd=0.40,08-ZsRtd=0.34,08-Flag=N&&AB41";
                var codes = Parser.GetPollutantCodes(msg);
                if (codes == null) return;
            }

            //test
            //new TinzDataGateway().Main();
            //Thread.Sleep(1000 * 60 * 60);
        }
    }
}
